package com.z2f.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel(value="返回对象", description="")
public class ResultSet {

    private String command;

    private String message;

    private Object objMes;

    private String token;

    private Integer code;

    private PageEntity pageEntity;

    @Override
    public String toString() {
        return "ResultSet{" +
                "command='" + command + '\'' +
                ", message='" + message + '\'' +
                ", objMes=" + objMes +
                ", token='" + token + '\'' +
                ", pageEntity=" + pageEntity +
                '}';
    }

    public static ResultSet ok(String message){
        ResultSet resultSet = new ResultSet();
        resultSet.command = "ok";
        resultSet.message = message;
        return resultSet;
    }

    public static ResultSet ok(Object objMes, PageEntity pageEntity,String message){
        ResultSet resultSet = new ResultSet();
        resultSet.command = "ok";
        resultSet.message = message;
        resultSet.objMes = objMes;
        resultSet.pageEntity = pageEntity;
        return resultSet;
    }

    public static ResultSet ok(Object objMes1,String message){
        ResultSet resultSet = new ResultSet();
        resultSet.command = "ok";
        resultSet.message = message;
        resultSet.objMes = objMes1;
        System.out.println("对象方法"+resultSet);
        return resultSet;
    }

    public static ResultSet ok(Object objMes1,String message,String token){
        ResultSet resultSet = new ResultSet();
        resultSet.command = "ok";
        resultSet.message = message;
        resultSet.objMes = objMes1;
        resultSet.token = token;
        System.out.println("对象方法"+resultSet);
        return resultSet;
    }


    public static ResultSet ok(Integer code,Object objMes1,String message,String token){
        ResultSet resultSet = new ResultSet();
        resultSet.code = code;
        resultSet.command = "ok";
        resultSet.message = message;
        resultSet.objMes = objMes1;
        resultSet.token = token;
        System.out.println("对象方法"+resultSet);
        return resultSet;
    }

    public static ResultSet ok(Object objMes){
        ResultSet resultSet = new ResultSet();
        resultSet.command = "ok";
        resultSet.message = "操作成功";
        resultSet.objMes = objMes;
        return resultSet;
    }

    public static ResultSet fail(String command,String message){
        ResultSet resultSet = new ResultSet();
        resultSet.command = command;
        resultSet.message = message;
        return resultSet;
    }

    public static ResultSet fail(String message){
        ResultSet resultSet = new ResultSet();
        resultSet.command = "no";
        resultSet.message = message;
        return resultSet;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public String getToken() { return token; }

    public void setToken(String token) { this.token = token; }

    public String getCommand() {
        return command;
    }

    public void setCommand(String command) {
        this.command = command;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getObjMes() {
        return objMes;
    }

    public void setObjMes(Object objMes) {
        this.objMes = objMes;
    }

    public PageEntity getPageEntity() {
        return pageEntity;
    }

    public void setPageEntity(PageEntity pageEntity) {
        this.pageEntity = pageEntity;
    }

}
